package com.example.switch_text.Controller;

import io.swagger.annotations.Api;
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiImplicitParams;
import io.swagger.annotations.ApiOperation;
import org.springframework.web.bind.annotation.*;

import javax.servlet.http.HttpServletResponse;

@RestController
@Api(tags = "用户管理相关接口")
@RequestMapping("/user")
public class getApi {

    @ApiOperation(value = "获取省市区接口", notes = "获取省市区接口")
    @ApiImplicitParams({
            @ApiImplicitParam(name = "del", value = "删除标记", required =false,paramType="query"),
            @ApiImplicitParam(name = "id", value = "编号", required =false,paramType="query"),
    })
    @GetMapping("/getAutoApi")
    public Integer getAutoInter(){
        Integer num = 1;
        return num;
    }

    @GetMapping("/{id}")
    @ApiOperation("根据id查询用户的接口")
    @ApiImplicitParam(name = "id", value = "用户id", defaultValue = "99", required = true)
    public Integer getUserById(@PathVariable Integer id) {
        return id;
    }

    @PostMapping("/getPostData")
    @ApiOperation("根据数据获取post的接口")
    @ApiImplicitParam(name = "appId",value="用户id",required = true)
    public Integer getPostData(@RequestBody Integer appId, HttpServletResponse response){
        System.out.println(response);
        return appId;
    }
}
